javascript convert string to float with 2 decimal places

114

javascript convert string to float with 2 decimal places -

var twoPlacedFloat = parseFloat(yourString).toFixed(2)

javascript convert string to float with 2 decimal places -

var twoPlacedFloat = parseFloat(yourString).toFixed(2)

get decimals from float javascript -

js> 2.3 % 1
0.2999999999999998

Comments

Submit
0 Comments